-- GENERATED SPELL FOR [Venomtail Scorpid] --


function spell0_3127(pUnit, Event) --@Claw,n/a--
pUnit:FullCastSpellOnTarget(16828,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3127', 530, 1)
end

function spell1_3127(pUnit, Event) --@Cower,n/a--
pUnit:FullCastSpellOnTarget(1742,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3127', 0, 1)
end

function spell2_3127(pUnit, Event) --@Growl,n/a--
pUnit:FullCastSpellOnTarget(14916,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3127', 0, 1)
end

function spell3_3127(pUnit, Event) --@Scorpid Poison,n/a--
pUnit:FullCastSpellOnTarget(24640,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3127', 10000, 1)
end

function spell4_3127(pUnit, Event) --@Venom Sting,n/a--
pUnit:FullCastSpellOnTarget(5416,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3127', 45000, 1)
end

function Sorts_3127(pUnit, Event)
local choix_sorts_3127 = math.random(0, 4)
if choix_sorts_3127 == 0 then
pUnit:RegisterEvent('spell0_3127', 1, 1)
end
if choix_sorts_3127 == 1 then
pUnit:RegisterEvent('spell1_3127', 1, 1)
end
if choix_sorts_3127 == 2 then
pUnit:RegisterEvent('spell2_3127', 1, 1)
end
if choix_sorts_3127 == 3 then
pUnit:RegisterEvent('spell3_3127', 1, 1)
end
if choix_sorts_3127 == 4 then
pUnit:RegisterEvent('spell4_3127', 1, 1)
end
end

function mob3127_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_3127', math.random(1500, 3000), 1)
end

function mob3127_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3127_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3127_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(3127, 1, 'mob3127_Action')
RegisterUnitEvent(3127, 2, 'mob3127_Leave')
RegisterUnitEvent(3127, 3, 'mob3127_Kill')
RegisterUnitEvent(3127, 4, 'mob3127_Die')
